<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
<title>图片轮换</title>
	<link rel="stylesheet" href="css/scroll.css">

</head>

<body>
<div class="scroll">
	<div id="num">
		<a href="#" onclick="d0()">1</a>
		<a href="#" onclick="d1()">2</a>
		<a href="#" onclick="d2()">3</a>
		<a href="#" onclick="d3()">4</a>
		<a href="#" onclick="d4()">5</a>
	</div>
	<img src="images/1.gif" alt="图片" id="photo"/>
</div>
<script type="text/javascript">
	//img文件的位置
	var img=document.getElementById("photo");
	function d0(){
	
		img.setAttribute("src","images/1.gif");

	}
	function d1(){
	
		img.setAttribute("src","images/2.gif");

	}
	function d2(){	
		img.setAttribute("src","images/4.jpg");

	}
	function d3(){
		
		img.setAttribute("src","images/3.jpg");

	}
	function d4(){
		
		img.setAttribute("src","images/5.gif");

	}
</script>
</body>
</html>
